package com.monster.threadsafe;

/**
 * description:
 * 以下类的value值由于使用了volatile关键字修饰，所以是线程安全的
 * @author Yuanml on 2021/4/3 19:41
 */
public class ThreadSafeIntegerByVolatile {
    private volatile Integer value;

    public Integer get() {
        return value;
    }

    public void set(Integer value) {
        this.value = value;
    }
}
